<?php
namespace froyo\cherry\Base;

use froyo\cherry\Base\BaseObject;

class BaseView extends BaseObject{

	public function render($_path_,$_params_ = [])
	{
		
		if(file_exists($_path_))
		{
			ob_get_length() ? ob_clean() : '';
	        ob_start();
	        ob_implicit_flush(false);
	        extract($_params_, EXTR_OVERWRITE);
			require $_path_;	
			return ob_get_clean();		
		}
		else
		{
			throw new \Exception($_path_.' View Not Found');
			
		}



	}
}